home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Interrupts.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  111 lines

  1. /*
  2.      File:        Interrupts.h
  3.  
  4.      Contains:    Public Interface to the Interrupt Manager.
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2 and beyond (including Copland)
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __INTERRUPTS__
  19. #define __INTERRUPTS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. #if PRAGMA_IMPORT_SUPPORTED
  30. #pragma import on
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  38. /*  Interrupt types  */
  39. typedef struct OpaqueInterruptSetID* InterruptSetID;
  40. typedef long InterruptMemberNumber;
  41. struct InterruptSetMember {
  42.     InterruptSetID                     setID;
  43.     InterruptMemberNumber             member;
  44. };
  45. typedef struct InterruptSetMember InterruptSetMember;
  46.  
  47.  
  48. enum {
  49.     kISTChipInterruptSource        = 0,
  50.     kISTOutputDMAInterruptSource = 1,
  51.     kISTInputDMAInterruptSource    = 2,
  52.     kISTPropertyMemberCount        = 3
  53. };
  54.  
  55. typedef InterruptSetMember ISTProperty[3];
  56. #define kISTPropertyName    "driver-ist" 
  57.  
  58. typedef long InterruptReturnValue;
  59.  
  60. enum {
  61.     kFirstMemberNumber            = 1,
  62.     kIsrIsComplete                = 0,
  63.     kIsrIsNotComplete            = -1,
  64.     kMemberNumberParent            = -2
  65. };
  66.  
  67. typedef Boolean InterruptSourceState;
  68.  
  69. enum {
  70.     kSourceWasEnabled            = true,
  71.     kSourceWasDisabled            = false
  72. };
  73.  
  74. typedef InterruptMemberNumber (*InterruptHandler)(InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount);
  75. typedef void (*InterruptEnabler)(InterruptSetMember ISTmember, void *refCon);
  76. typedef InterruptSourceState (*InterruptDisabler)(InterruptSetMember ISTmember, void *refCon);
  77.  
  78. enum {
  79.     kReturnToParentWhenComplete    = 0x00000001,
  80.     kReturnToParentWhenNotComplete = 0x00000002
  81. };
  82.  
  83. typedef OptionBits InterruptSetOptions;
  84. /*  Interrupt Services  */
  85. extern OSStatus CreateInterruptSet(InterruptSetID parentSet, InterruptMemberNumber parentMember, InterruptMemberNumber setSize, InterruptSetID *setID, InterruptSetOptions options);
  86.  
  87. extern OSStatus InstallInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void *refCon, InterruptHandler handlerFunction, InterruptEnabler enableFunction, InterruptDisabler disableFunction);
  88.  
  89. extern OSStatus GetInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void **refCon, InterruptHandler *handlerFunction, InterruptEnabler *enableFunction, InterruptDisabler *disableFunction);
  90.  
  91. extern OSStatus ChangeInterruptSetOptions(InterruptSetID setID, InterruptSetOptions options);
  92.  
  93. extern OSStatus GetInterruptSetOptions(InterruptSetID setID, InterruptSetOptions *options);
  94.  
  95. #endif
  96.  
  97. #if PRAGMA_ALIGN_SUPPORTED
  98. #pragma options align=reset
  99. #endif
  100.  
  101. #if PRAGMA_IMPORT_SUPPORTED
  102. #pragma import off
  103. #endif
  104.  
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108.  
  109. #endif /* __INTERRUPTS__ */
  110.  
  111.